import Api from '@/api/payment/currency'
import i18n from "@/lang/index";
const contentConfig = {
  pageName: "sys:user",
  table: {
    border: true,
    highlightCurrentRow: false,
  },
  indexAction: (data) => {
    console.log("index", data);
    return new Promise((resolve, reject) => {
      Api.getList(data).then(s => {
        console.log(s);
        resolve(s)
      }).catch(e => {
        console.log(e);
        reject(e)
      })
    });
  },
  deleteAction: function (id) {
    console.log("delete", id);
    return new Promise((resolve, reject) => {
      Api.del({ id }).then(s => {
        resolve({
          code: "00000",
          data: null,
          msg: i18n.global.t("hint.7"),
        })
      }).catch(e => {
        reject(e)
      })
    });
  },
  exportAction: function (queryParams) {
    // 导出Excel文件
    return exportUser(queryParams);
  },
  pk: "id",
  toolbar: [
    "refresh",
    "add",
    // "delete",
    // "export",
    // {
    //   name: "import",
    //   icon: "upload",
    //   text: "导入",
    //   auth: "import",
    // },
  ],
  cols: [
    { type: "selection", width: 50, align: "center" },
    { label: "ID", align: "center", prop: "id", width: 100 },
    { label: i18n.global.t("label.12"), align: "center", prop: "code",  },
    { label: i18n.global.t("label.55"), align: "center",templet: 'custom', prop: "image", },
    { label: i18n.global.t("label.56"), align: "center", prop: "symbol",  },
    { label: i18n.global.t("label.38"), align: "center", type: "time", prop: "created_at", width: 180 },
    {
      label: i18n.global.t("label.8"),
      fixed: "right",
      width: 220, align: "center",
      templet: "tool",
      operat: [
        "edit",
        "delete",
      ],
    },
  ],
};

export default contentConfig;
